package com.ibm.wd150.ticketing;

import com.ibm.wd150.passengers.Passenger;

public class Ticket {

	private Passenger passenger;
	private Seat seat;
	private double price;

	private long ticketNo;

	private static long count = 0;

	public Seat getSeat() {
		return seat;
	}

	public void setSeat(Seat seat) {
		this.seat = seat;
	}

	public double getPrice() {
		return price;
	}

	public void setPrice(double price) {
		this.price = price;
	}

	public long getTicketNo() {
		return ticketNo;
	}

	public void setTicketNo(long ticketNo) {
		this.ticketNo = ticketNo;
	}

	public Passenger getPassenger() {
		// TODO Auto-generated method stub
		return this.passenger;
	}

	public Ticket(Passenger passenger, Seat seat, double price) {
		this.passenger = passenger;
		this.price = price;
		this.seat = seat;
		this.ticketNo = ++count + 1000000;
	}

	public String toString() {
		return this.ticketNo + " for seat " + seat.getRow() + seat.getLetter()
				+ " at $" + price;
	}
}
